package com.jeesite.modules.app.customer.credit.rule;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jeesite.common.mapper.JsonMapper;
import com.jeesite.modules.conf.AppController;
import com.jeesite.modules.conf.MessageCode;
import com.jeesite.modules.zx.credit.rule.entity.TcreditRule;
import com.jeesite.modules.zx.credit.rule.service.TcreditRuleService;

@Controller
@RequestMapping(value = "/app/customer/credit/rule/")
public class AppCreditRuleController {
	@Autowired
	private TcreditRuleService tcreditRuleService;
	@RequestMapping(value="findList")
	public void findList(HttpServletRequest request,HttpServletResponse response){
		TcreditRule entity=new TcreditRule();
		List<TcreditRule> findList = tcreditRuleService.findList(entity);
		JSONArray parseArray = JSONObject.parseArray(JsonMapper.toJson(findList));
		AppController.renderSuccessObject(response, parseArray, MessageCode.SUCCESS_ACK);
	}
}
